# -------------------------------------------------------------------
#       -*- coding: utf-8 -*-
#   @Project    :   studentSystem
#   @File       :   dateCalc.py
#   @Author     :   WANGYU
#   @Time       :   2021-09-13 17:22:37
#   @Software   :   PyCharm
#   @Desc       :   
# -------------------------------------------------------------------


import datetime
from time import strptime


def inputdate():
    indate = input('输入日期（20200808）后按回车：')
    if indate == '00000000':
        print('无限假期')

    else:
        indate = indate.strip('')
        datestr = indate[0:4] + '-' + indate[4:6] + '-' + indate[6:]
        return datetime.datetime.strptime(datestr, '%Y-%m-%d')


if __name__ == '__main__':
    print('-' * 40)
    sdate = inputdate()

    in_num = input('输入假期天数(如年假15天，路途0天，节假日7天。表示为:15，0，7)：')

    vacation, traveltime, holiday = in_num.split(',')
    sum_num = int(vacation) + int(traveltime) + int(holiday)

    fdate = sdate + datetime.timedelta(days=sum_num)

    print('推算的日期是：' + str(fdate).split(' ')[0])
